package com.olt.server.log;

import com.olt.dao.log.LogDao;
import com.olt.domain.log.OltLog;
import com.olt.domain.user.OltRole;
import com.olt.server.dto.PageInput;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServer {
    @Autowired
    LogDao logDao;
    public Page<OltLog> getOltLog(PageInput input){
        Pageable page= PageRequest.of(input.getCurrentPage(), input.getSize());
        return logDao.findAllByOrderByLogIdDesc(page);
    }
}
